<html><head><title>SetOrigin</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">SetOrigin()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#3A3966"><b>SetOrigin</b></font>(x, y)  </blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Set an offset at which all drawing in the current output takes place. 
This defines the location of the coordinates (0, 0) within the output for 
every following drawing command. By default, the origin is located in the 
upper left corner of the drawing output. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>x, y</i></td>
<td width="90%"> 
The new position of the drawing origin. This is an absolute location and is not 
affected by any previous call to this function. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Remarks</b></p><blockquote>

This command affects the location of all future drawing commands with the exception of the 
<a href="clipoutput.html">ClipOutput()</a> command and the <a href="setorigin.html">SetOrigin()</a> command itself. Also, the coordinates received 
in a <a href="customgradient.html">CustomGradient()</a> or <a href="customfiltercallback.html">CustomFilterCallback()</a> callback are always absolute regardless 
of any calls to this function. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 200, 200, &quot;2DDrawing Example&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateImage</font>(0, 200, 200, 24, $FFFFFF) <b><font color="#3A3966">And</font></b> <font color="#3A3966">StartDrawing</font>(<font color="#3A3966">ImageOutput</font>(0))
        
      <font color="#3A3966">; Draw the same figure at different locations by moving the drawing origin</font>
      <b><font color="#3A3966">For</font></b> x = 0 <b><font color="#3A3966">To</font></b> 120 <b><font color="#3A3966">Step</font></b> 40
        <b><font color="#3A3966">For</font></b> y = 0 <b><font color="#3A3966">To</font></b> 120 <b><font color="#3A3966">Step</font></b> 60
<font color="#3A3966">          SetOrigin</font>(x, y)
<font color="#3A3966">          Box</font>(0, 0, 30, 30, $FF0000)
<font color="#3A3966">          Circle</font>(15, 15, 10, $00FF00)
        <b><font color="#3A3966">Next</font></b> y
      <b><font color="#3A3966">Next</font></b> x   
         
<font color="#3A3966">      StopDrawing</font>() 
<font color="#3A3966">      ImageGadget</font>(0, 0, 0, 200, 200,<font color="#3A3966"> ImageID</font>(0))      
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<br>
<p><img src="../HelpPictures/setorigin.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getoriginx.html">GetOriginX()</a>, <a href="getoriginy.html">GetOriginY()</a>, <a href="clipoutput.html">ClipOutput()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=roundbox.html>RoundBox()</a> - <a href="index.html">2DDrawing Index</a> - <a href="startdrawing.html">StartDrawing()</a> -><br><br>

</body></html>